Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add getConnections method and deprecate getSkeleton for bodyPose #227

Merged
merged 3 commits into from
Nov 1, 2024

Conversation

ziyuan-linn
Copy link
Member

This PR adds the getConnections method to bodyPose and deprecates the original getSkeleton method for bodyPose. The two methods are functionally identical.

  • add getConnections method and make getSkeleton an alias
  • mark getSkeleton as deprecated
  • update the skeleton example to use getConnections instead of getSkeleton

@shiffman
Copy link
Member

This is great! Before merging I just want to check with @MOQN @gohai and @jackbdu who are teaching with ml5.bodyPose(). This will also affect documentation cc @QuinnHe @alanvww @myrahsa. A quick summary:

  1. handPose and bodyPose will both include getConnections() which return the pairs of connected keypoints.
  2. getSkeleton() will still work for bodyPose but is marked as "deprecated."

I'd like to merge this relatively soon so that we can get it into an upcoming release. Thank you!

@shiffman shiffman mentioned this pull request Oct 29, 2024
@gohai
Copy link
Member

gohai commented Oct 29, 2024 via email

@shiffman
Copy link
Member

Thank you @gohai, I think that's a great suggestion! I think the idea of deprecated is that it would never be removed until we have a major release (2.0) at which time we might introduce breaking changes. I'm also ok with keeping both "forever" and having getSkeleton() essentially be an alias to getConnections(). I did cover it as getSkeleton() in my ml5.js bodyPose video: https://youtu.be/T99fNXTUUaQ

@gohai
Copy link
Member

gohai commented Oct 29, 2024 via email

@MOQN
Copy link
Member

MOQN commented Oct 30, 2024

This is great! Thank you. We will update the website once it's applied to the library!

@jackbdu
Copy link

jackbdu commented Oct 30, 2024

All looks great to me! Looking forward to the next release.

* An alias for `getConnections`. This method is deprecated and will be removed in the future.
* @returns {number[][]} an array of pairs of indices containing the connected keypoints.
* @public
* @deprecated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One last little detail here. Following up on my discussion with @gohai, would it make sense to take out "will be removed in the future" and well as "@deprecated" and just leave both methods in, one as an alias? Or is that confusing / bad practice? Would this make the documentation confusing to have two methods that do the same thing? cc @MOQN @QuinnHe @alanvww

We can always change our mind later, we don't have to feel this is set in stone.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can take it out for now!

@MOQN
Copy link
Member

MOQN commented Oct 30, 2024

This had me really ponder; please allow me to share my humble thoughts. 🙏

I initially thought that it would be best if the alias were deprecated and removed in the future to minimize confusion. I really like getConnections() because it can be applied uniformly across multiple models. However, in this particular case, I am leaning towards keeping both functions (at least for a few more months to see how they are used).

This is based on my experience with other motion capture systems; I mostly used the term 'skeleton' rather than 'connections' while using their SDKs and relevant libraries. I assume that some users and our students might search for references using the keyword 'skeleton.' So, in this case, it would be great if they could find getConnections() as the primary function and learn getSkeleton() as an alias function.

@shiffman
Copy link
Member

shiffman commented Nov 1, 2024

Thank you @MOQN for your thoughts! This is good to go! Merging! I believe this is the last piece of the puzzle for the next release to incorporate these new methods and data structures!

@shiffman shiffman merged commit 5caa7a2 into main Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants